@extends('layouts.index')
@section('title',trans('web.course_upload'))
    @section('css')
        <link rel="stylesheet" href="{{asset('manger/plugins/layui2.0/css/layui.css')}}" media="all" />
        @endsection
    @section('content')
        <div class="main-container">
            <div>
                <div class="account-process__step-head account-process__step-head--active">
                    <div class="span2 span4-mobile pixel-pattern-overlay pixel-pattern-overlay--01 account-process__step-head__counter"></div>
                    <div class="span12 span10-mobile account-process__step-head__content">
                        <div class="account-block-content account-block-content--small-aside">
                            <div class="">
                                <aside class="span3 span12-tablet span10-mobile account-block-content__aside">
                                    <font style="vertical-align: inherit;">
                                        <font style="vertical-align: inherit;">@lang('web.course')</font>
                                    </font>
                                </aside>
                                <div class="span9 span100p-tablet span100p-mobile account-block-content__content">
                                    <div class="account-block-content__content__summary">
                                        <p><strong></strong><br>
                                            <!-- react-text: 4338 -->
                                            <!-- /react-text -->
                                        </p>
                                    </div>
                                </div>
                                <div class="cf"></div>
                            </div>
                        </div>
                    </div>
                    <div class="cf"></div>
                </div>

                <div class="account-process__step account-process__step--active">
                    <div class="span2 hide-mobile"><br></div>
                    <div class="span12 span14-mobile account-process__step__content">
                        <form method="post" action="{{route('course_post')}}" novalidate="" id="id5">
                            {{csrf_field()}}
                            <div class="account-block-content account-block-content--small-aside">
                                <div class="">
                                    <aside class="span3 span12-tablet span10-mobile account-block-content__aside">@lang('web.basic_desc')
                                    </aside>
                                    <div class="span9 span100p-tablet span100p-mobile account-block-content__content">
                                        <div class="account-block-content__default">
                                            <div class="account-block-content__default__section span3 span5-tablet span11-mobile">
                                                <label class="custom-label relative">
                                                    <span class="custom-label__label">@lang('web.course_name')</span>
                                                    <input type="text" id="title" name="title" label="Project name" value="{{old('title')}}" class="custom-input__input" style="padding-left: 10px;">
                                                </label>

                                            </div>
                                        </div>
                                            <div class="account-block-content__default">
                                                <div class="account-block-content__default__section span3 span5-tablet span11-mobile">
                                                    <label class="custom-label relative">
                                                        <span class="custom-label__label">@lang('web.course_type')</span>
                                                        <select name="category_id" class="custom-input__input">
                                                            @foreach($config as $k=>$v)

                                                            <option value="{{$k}}" @if(old('category_id')==$k) selected @endif>{{$v}}</option>
                                                                @endforeach
                                                        </select>
                                                    </label>

                                                </div>
                                            </div>
                                        <div class="account-block-content__default">
                                            <div class="account-block-content__default__section span5 span5-tablet span11-mobile">
                                                <label class="custom-label relative">
																<span class="custom-label__label">@lang('web.course_content')<span class="custom-label__label__btw"></span>
																<span class="custom-label__label__btw"></span></span>
                                                    <textarea class="layui-textarea layui-hide custom-input__textarea span8-tablet span100p-mobile" name="content"  id="editor"  rows="6" >
                                                        {{old('content')}}
                                                    </textarea>

                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="cf"></div>
                                </div>
                            </div>


                            <!--富文本编辑器放在下边这个div中-->
                            <div class="account-block-content account-block-content--small-aside"></div>
                            <div class="account-block-content pixel-pattern pixel-pattern--01 account-block-content--small-aside">
                                <div class="">
                                    <aside class="span3 span12-tablet span10-mobile account-block-content__aside account-block-content__aside--no-content"></aside>
                                    <div class="span9 span100p-tablet span100p-mobile account-block-content__content">
                                        <div class="span9 span100p-tablet span100p-mobile">
                                            <div class="account-process__button-area"><button type="submit" class="button--dark course-submit">@lang('web.submit')</button></div>
                                        </div>
                                    </div>
                                    <div class="cf"></div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="cf"></div>
                </div>
            </div>
        </div>
        <script type="text/javascript" src="{{asset('manger/plugins/layui2.0/layui.js')}}"></script>

        <script>
            layui.use('layedit',function(){
                var layedit=layui.layedit;

                $.ajaxSetup({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    }
                });
                layedit.set({
                    uploadImage: {
                        url: '/image/upload' //接口url
                        ,type: 'post' //默认post

                    }
                });
                var editIndex=layedit.build('editor',{
                    hideTool:['face'],
                });
            })
        </script>
        @endsection